S = 'Spam'
print(len(S))
print(S.istitle())

line = 'ааа\n,bbb\n,ссссс\n,dd\n'
print(line.rstrip().split (','))
print(S.__hash__())
print(S.__hash__())
print(S.__hash__())
print(line.swapcase())
print(S.partition('a'))
print(help(S.partition))
print(r'test\1qsasdasd')
print(u'sp\u00c3m')
print('spamы'.encode('utf-8'))
print('spamы'.encode('utf-16'))
print(b's\x00p\x00a\x00m\x00K\x04'.decode('utf-16-le'))
print(b'\xff\xfes\x00p\x00a\x00m\x00K\x04'.decode('utf-16'))
print('\x40\x4b')

import chardet 
the_encoding = chardet.detect(b'\xff\xfes\x00p\x00a\x00m\x00K\x04')['encoding']
print(the_encoding)

print('х'+ b'y'.decode())
print('\u00A3')
print('\u00A3'.encode('latin-1'))
print(b'\xa3'.decode('latin-1'))
print("'test quotes'")

filestr = b'\xff\xfes\x00p\x00a\x00m\x00K\x04'
file = open("text.txt", "w")
file.write(filestr.decode('utf-16'))
file.writelines(line.rstrip().split (','))
file.close()
file = open('text.txt')
print(file.readlines())
file.close()

import struct
packed = struct.pack('>i4sh' , 7, b'spam', 8)
file = open ('data.bin' , 'wb')
file.write (packed)
file.close()

data = open('data.bin', 'rb').read()
print(list(data))
print(struct.unpack('>i4sh', data))

print(set ('spam') - set ('ham'))
print(set ('ham') - set ('spam'))

print(2/3)
print(2/3 + 1/2)
import decimal
print(decimal.Decimal(2/3))
print(decimal.Decimal(2)/decimal.Decimal(3))
print(decimal.Decimal(2/3) + decimal.Decimal(1/2))

print(decimal.Decimal(4.3e+21))
е = 0.1
е = 0.2